<script src="${rc.getContextPath()}/manage/js/dwzCustomJs/dwz.custom.advancedquery.js?v=${ver}" type="text/javascript"></script>

<#include "/common/pagerForm.html">
<form rel="pagerForm" method="post" action="" onsubmit="return navTabSearch(this)">
	<div class="pageHeader">
		<div class="searchBar">
			<ul class="searchContent">
				<li >
					<input type="hidden" id="advancedStatus" name="advancedStatus" value="${condition.advancedStatus!''}" />
	            	<label><@label key='operationTaskNum.C,colon'>工序任务单编号：</@label></label> 
	            	<input type="text" name="operationTaskNum" value="${condition.operationTaskNum!''}"/>
            	</li>
				<li>
					<label><@label key="workCenter.C,colon">工作中心：</@label></label> 
					<input id="workCenterGrp.workCenterCode" name="workCenterCode" type="text"  suggestFields="workCenterCode,workCenterText" postField="workCenterCode" 
					suggestUrl="${rc.getContextPath()}/manage/workCenter/workCenterSuggest?hr=hr" lookupGroup="workCenterGrp" autocomplete="off"  value="${page.workCenterCode!''}"/>
				</li>
				<li>
					<label><@label key='plannedWorkUnitCode.C,colon'>计划作业单元：</@label></label> 
	            	<input type="text" name="plannedWorkUnitCode" value="${condition.plannedWorkUnitCode!''}"/>
				</li>
				
			</ul>
			<ul class="searchContent">
				<li>
					<label id="operationCode"><@label key="operationCode.C,colon">工序编号：</@label></label> 
					<input type="text" class="textInput" name="operationCode" value="${condition.operationCode!''}" />
				</li>
				<li>
					<label><@label key='materialCode.C,colon'>物料编号：</@label></label>
					<input class="look" id="materialLookup.materialCode" name="materialCode" type="text" postField="materialCode" suggestFields="materialCode,materialText" value="${condition.materialCode!''}"
					suggestUrl="${rc.getContextPath()}/manage/material/componentSuggest" lookupGroup="materialLookup" remote="${rc.getContextPath()}/manage/material/validateMaterial" warn="<@label key='materialCodeNotExists.M'>物料编号不存在</@label>"/>
					<a class="btnLook" href="${rc.getContextPath()}/manage/material/componentLookUp?lookupType=radio" rel="materialLookup_dialog" title="<@label key='select.C,materialCode.C'>选择物料</@label>"  lookupGroup="materialLookup" ></a>
				</li>
				<li>
					<label><@label key='materialText.C,colon'>物料描述：</@label></label> 
	            	<input type="text" name="materialText" value="${condition.materialText!''}"/>
				</li>
				
            </ul>
            <ul class="searchContent">
           		<li><label><@label key='plannedStartDate.C,colon'>计划日期从：</@label></label>
					<input type="text" class="date required from" name="plannedStartDateTime"  max_date="{plannedendDateTime}" value="${condition.plannedStartDateTime!''}"/>
					<a class="inputDateButton" href="javascript:;">选择</a>
				</li>
				<li><label><@label key="to.C,colon">至：</@label></label>
					<input type="text"  class="date required from" name="plannedendDateTime" readonly="readonly" min_date="{plannedStartDateTime}" value="${condition.plannedendDateTime!''}"/>
					<a class="inputDateButton" href="javascript:;">选择</a>
				</li>
				
				<li class="query">
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit"><@label key="query.B">查询</@label></button>
						</div>
					</div>
				</li>
				<li class="advancedQuery" >			
					<a id="advancedQuery"href="javascript:void(0);"   onclick="openAdvanced(navTab.getCurrentPanel())">
						<@label key="advancedQuery.C">高级查询</@label>
					</a>
					<span  onclick="openAdvanced(navTab.getCurrentPanel());"></span>			
				</li>
			</ul>
		</div>
	</div>
	<div id="collapsablePanel" style="display:none;" class="pageHeader" >
		<div class="searchBar">
			<ul class="searchContent">
				<li>
	            	<label><@label key='productionOrderNum.C,colon'>生产订单号：</@label></label>
	            	<input type="text" name="productionOrderNum" value="${condition.productionOrderNum!''}" />
	            </li>
	            <li>
	        		<label><@label key='orderType.C,colon'>订单类型：</@label></label> 
	                <select name="orderTypeCode">
	                    <option value="" ><@label key='all.C'>所有</@label></option>
	                    <#if orderTypes??>
	                        <#list orderTypes as orderType>
	                            <option value="${orderType.orderTypeCode!''}" <#if condition.orderTypeCode?? && condition.orderTypeCode == orderType.orderTypeCode> selected</#if> >${orderType.orderTypeText!''}</option>
	                        </#list>
	                    </#if>
	                </select>
	            </li>
				<li>
	            	<label><@label key='productionControlNum.C,colon'>生产管理号：</@label></label>
	            	<input type="text" name="productionControlNum" value="${condition.productionControlNum!''}" />
	            </li>
			</ul>
			
			<ul class="searchContent">
				<li>
	            	<label><@label key='productionlotNum.C,colon'>生产批次号：</@label></label>
	            	<input type="text" name="productionlotNum" value="${condition.productionlotNum!''}" />
	            </li>
	            <li>
	            	<label><@label key='customer.C,colon'>客户：</@label></label> 
	            	<input type="text" name="customer" value="${condition.customer!''}"/>
	            </li>
	            <li>
	            	<label><@label key='customerOrder.C,colon'>客户订单：</@label></label> 
	            	<input type="text" name="customerOrder" value="${condition.customerOrder!''}"/>
	            </li>
	            <li>
	            	<label><@label key='priority.C,colon'>优先级：</@label></label> 
	            	<input type="text" name="priority" class="digits"  maxlength="5"/ value="${condition.priority!''}"/>
	            </li>
			</ul>
		</div>
	</div>	
</form>

<div class="pageContent">

    <div class="panelBar">
        <ul class="toolBar">
            <@buttonRight menuCode="OPERATIONARRANGEPLANTOEXCEL" labelKey="add.B" defalutName="导出excel">
            <li>
                <a class="export" mask="true" target='dwzExport' title="<@label key='confirmexportToExcel.M'>确定要导出这些记录吗?</@label>"
                 href="${rc.getContextPath()}/manage/operationTask/operationArrangePlanToExcel?navTabId=${navTabId!''}" 
                 ><span><@label key='exportToExcel.D'>导出EXCEL</@label></span> </a>
            </li> 
            </@buttonRight> 
        </ul>
    </div>
    <table class="table" width="150%" layoutH="194">
        <thead>
            <tr>
                <th width="20"><@label key="serialNumber.C">序号</@label></th>     
                <th width="60" orderField="operationTaskNum"<#if (page.orderField?? && page.orderField == 'operationTaskNum')>class="${page.orderDirection!''}"</#if>><@label key='operationTaskNum.C'>工序任务单</@label></th>
                <th width="100"><@label key='materialCode.C'>物料编号</@label></th>
                <th width="100"><@label key='materialText.C'>物料名称</@label></th>
                <th width="100"><@label key='plannedWorkUnitCode.C'>计划作业单元编号</@label></th>
                <th width="100"><@label key='plannedWorkUnitText.C'>计划作业单元名称</@label></th>
                <th width="100"><@label key="operationCode.C">工序</@label></th>
                <th width="80"><@label key='operationText.C'>工序描述</@label></th>                
                <th width="60"><@label key='plannedQuantity.C'>计划数量</@label></th>
				<th width="80" orderField="plannedStartDateTime"<#if (page.orderField?? && page.orderField == 'plannedStartDateTime')>class="${page.orderDirection!''}"</#if>><@label key='plannedstartDateTime.C'>计划开始时间</@label></th>
                <th width="80" orderField="plannedendDateTime"<#if (page.orderField?? && page.orderField == 'plannedendDateTime')>class="${page.orderDirection!''}"</#if>><@label key='plannedendDateTime.C'>计划截至时间</@label></th>
            
                <th width="80"><@label key='workCenterCode.C'>工作中心</@label></th>
                <th width="80"><@label key='workCenterText.C'>工作中心描述</@label></th>
                <th width="80"><@label key='productionControlNum.C'>生产管理号</@label></th>
                <th width="80"><@label key='productionOrderNum.C'>生产订单编号</@label></th>
             </tr>
        </thead>
        <tbody>
        <#if page??><#if (page.data?size>0)> <#list page.data as operationTask>
            <tr>
            	<td>${page.startRow + operationTask_index}</td>
            	<td><a name="operationTaskPro" class="link">
            		${operationTask.operationTaskNum!''}</a></td>
            	<td>${operationTask.materialCode!''}</td>
                <td>${operationTask.materialText!''}</td>
                <td>${operationTask.plannedWorkUnitCode!''}</td>
                <td>${operationTask.plannedWorkUnitText!''}</td>
                <td>${operationTask.operationCode!''}</td>
                <td>${operationTask.operationText!''}</td>                
                <td>${operationTask.plannedQuantity!''}</td>
                <td>${(operationTask.plannedStartDateTime?string("yyyy-MM-dd"))?if_exists}</td>
                <td>${(operationTask.plannedendDateTime?string("yyyy-MM-dd"))?if_exists}</td>    
                <td>${operationTask.workCenterCode!''}</td>
                <td>${operationTask.workCenterText!''}</td>
                <td>${operationTask.productionControlNum!''}</td>
                <td>${operationTask.productionOrderNum!''}</td>               
			</tr>
        </#list>
        <#else>
        <tr target="detailOutput_id">
                <td colspan="8" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
        </tr>
        </#if>
        <#else>
        <tr target="detailOutput_id">
                <td colspan="8" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
        </tr>
        </#if>
        </tbody>
    </table>
    <#include "/common/panelBar.html">
</div>
<script type="text/javascript">
	(function($){
		initAdvancedQuery(navTab.getCurrentPanel());
		var $page = DWZ.context(),
		viewOperationTaskProgress = function(text) {
			path = hostUrl
				+ "/operationTask/viewOperationArrangePlan?operationTaskNum="+text,
			title = text+"详情";
			$.pdialog.open(path, '', title, {
				width : 600,
				height :570,
				minable : false,
				mask : true,
				resizable : false
			});
		};
		$('td a[name=operationTaskPro]', $page).on('click', function(){
			var $this = $(this);
			viewOperationTaskProgress($this.text().replace(/(^\s+)|(\s+$)/g, ""));		
			return false;
		});
	})(jQuery);
</script>
